package com.necsv;

import com.necsv.Mylog.Mylog;
import com.necsv.Mylog.Mytoast;

import android.app.Activity;
import android.content.Intent;
import android.media.MediaPlayer;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.util.Log;

public class MainActivity extends Activity {

	/** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.splash);
        GoogleAnaTool.start(this);
        GoogleAnaTool.trackStarted();
        
        final Handler mHandler = new Handler(){

			@Override
			public void handleMessage(Message msg) {
				// TODO Auto-generated method stub
				super.handleMessage(msg);
				Mylog.Toat(getBaseContext(), "end thread sleep");
			}
        	
        };
        
        
        Thread logoTimer = new Thread()
        {
			@Override
			public void run() {
				// TODO Auto-generated method stub
				try {
					int logonTimer = 0;
					while(logonTimer < 3000)
					{
						sleep(100);
						logonTimer += 100;
					}
					mHandler.sendEmptyMessage(0);
					startActivity(new Intent("com.necsv.CLEARSCREEN"));
					
				} catch (Exception e) {
					Log.v("log", "err timer");
					// TODO: handle exception
				}
				
			}
        	
        };
        logoTimer.start();
    }
    
    
  
    @Override
    protected void onDestroy() {
    	// TODO Auto-generated method stub
    	GoogleAnaTool.stop(this);
    	super.onDestroy();
    	//mpSplash.release();
    }
    @Override
    protected void onPause() {
    	// TODO Auto-generated method stub
    	super.onPause();
    }
}